﻿using DemoPrism.Extensions;
using DemoPrism.Models;
using DemoPrism.Services;
using DemoPrism.Views;
using System.Configuration;
using System.Data;
using System.Net;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;

namespace DemoPrism
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : PrismApplication
    {
        /// <summary>
        /// 使用容器创建主窗体123
        /// </summary>
        /// <returns></returns>
        protected override Window CreateShell()
        {
            return Container.Resolve<MainWindow>();
        }
        /// <summary>
        /// 123123
        /// </summary>
        /// <param name="containerRegistry"></param>
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            // 注册核心服务
            containerRegistry.RegisterSingleton<IAuthenticationService, AuthenticationService>();
            containerRegistry.RegisterSingleton<ILanguageService, LanguageService>();
            containerRegistry.RegisterSingleton<ITenantService, TenantService>();

            // 注册对话框
            containerRegistry.RegisterDialog<ChangePasswordDialog, ChangePasswordViewModel>();
            containerRegistry.RegisterDialog<EmailVerificationDialog, EmailVerificationViewModel>();
            containerRegistry.RegisterDialog<LoginDialog, LoginViewModel>();
        }

        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            moduleCatalog.AddModule<SettingsModule>();
            moduleCatalog.AddModule<AuthenticationModule>();
            moduleCatalog.AddModule<UserManagementModule>();
        }
    }

}
